<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/internal/MacroTools.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li><li class="navelem"><a class="el" href="dir_1865c4ce8b99f52bbeabfd52bfdd7cd3.html">internal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">MacroTools.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="socket_2internal_2_macro_tools_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*****************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">*  @file     SocketTool.h                                                    *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">*  @brief    tcp 内部结构体、宏定义头文件                                    *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">*  @author   weiqi.li                                                        *</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">*  @email    wcmxiaolizi@foxmail.com                                         *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">*  @remarks  仅dll内部使用的文件                                             *</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">*  @version  1.0.0.0                                                         *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">*****************************************************************************/</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef ____SOCKETOOLS_H__</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#define ____SOCKETOOLS_H__</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;../../tools/tools.h&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117">   16</a></span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">enum</span> <a class="code" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117">OperatorType</a></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117ab3eb5fc1c2881f12082d288b4fc0362a">read_op</a>,</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117a495315afb928424392a304f43d96cadb">write_op</a>,</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117a0fe13fc305ec60c5bb2c1cf11115ba4c">op_size</a></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;};</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1">   23</a></span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117ab3eb5fc1c2881f12082d288b4fc0362a">   24</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1">IoCompleteKey</a></div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117a495315afb928424392a304f43d96cadb">   25</a></span>&#160;{</div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117a0fe13fc305ec60c5bb2c1cf11115ba4c">   26</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a1240b20d386d820628fc3346421cb5be">ASYNC_NORMAL</a>,</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a411478bc403c60e45d9ec2a8a81ccff5">   27</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1add077376f83a9d647391982e5ab6165f">ASYNC_CLOSE</a>,</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a98eb1c6912b405f72077623bf35b84d0">   28</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a411478bc403c60e45d9ec2a8a81ccff5">ASYNC_TIMEOUT</a>,</div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a0bf0069a0dc92f478e26530b34724c54">   29</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a98eb1c6912b405f72077623bf35b84d0">ASYNC_EXIT</a>,</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a0bf0069a0dc92f478e26530b34724c54">ASYNC_COMPLETE</a>,</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1ae9092fcf5b69fe04c51407da6f78d71a">   31</a></span>&#160;    <span class="comment">//ASYNC_FAILED,</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a53a0b28e438eedaa078b3e5caf7683b0">   32</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1ae9092fcf5b69fe04c51407da6f78d71a">ASYNC_INIT</a>,</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1acbced1b41bfc12f3d43285c159dbd2cf">   33</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a53a0b28e438eedaa078b3e5caf7683b0">ASYNC_ACCEPT</a>,</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11">   34</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1acbced1b41bfc12f3d43285c159dbd2cf">ASYNC_CONNECT</a>,</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11">ASYNC_MAX</a>,</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;};</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0">   37</a></span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">enum</span> <a class="code" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0">UpdateAction</a></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0aad86562c2b3d6e7eb6f89c9e373d916b">   39</a></span>&#160;{</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0abfd6aec6483c4db68bcdd242b3712e2f">   40</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0aad86562c2b3d6e7eb6f89c9e373d916b">DELETE_ACTION</a>,  <span class="comment">// 删除</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0a6fdfab6b4db26c3b4f122765b77e5061">   41</a></span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0abfd6aec6483c4db68bcdd242b3712e2f">UPDATE_ACTION</a>,  <span class="comment">// 更新</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <a class="code" href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0a6fdfab6b4db26c3b4f122765b77e5061">ADD_ACTION</a>      <span class="comment">// 增加</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;};</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">// typedef tow_function&lt;DWORD, CSockError, void*&gt; AcceptComplete;</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">// typedef three_function&lt;DWORD, DWORD, CSockError, void*&gt; WRComplete;</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">// typedef tow_function&lt;DWORD, CSockError, void*&gt; TimeoutComplete;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">// typedef tow_function&lt;DWORD, CSockError, void*&gt; CloseComplete;</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a594566cc6256a59265af97f3fb79f46e">   49</a></span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#define CHECK_BIND_SERVER_GOTO(sock, ec, lable) \</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">    if (sock.GetService()-&gt;GetIoPortService() != this || sock.GetServiceBuffer()-&gt;isBindService == FALSE) \</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">    { \</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::BIND_SERVER_ERROR); \</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">        goto lable;\</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">    }</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a402712afaac5db73261c42486b37fb26">   56</a></span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">#define CHECK_BIND_SERVER(sock, ec) \</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">    if (sock.GetService()-&gt;GetIoPortService() != this || sock.GetServiceBuffer()-&gt;isBindService == FALSE) \</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">    { \</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::BIND_SERVER_ERROR); \</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">    }</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a70ca7033ad60da03feeda19abbe7a01f">   62</a></span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor">#define CHECK_SOCKET_INIT_GOTO(bInit, cliSock, svrSock, ec, lable) {\</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">    if (!cliSock.GetServiceBuffer()) \</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="preprocessor">    {\</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::UNINIT); \</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor">        goto lable; \</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor">    }\</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">    if (bInit &amp;&amp; *cliSock.GetSockPtr() == INVALID_SOCKET) \</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor">    { \</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">        ec = cliSock.Socket(svrSock.GetSocketData()-&gt;_sockaddr.GetDomain(), svrSock.GetSocketData()-&gt;_type, svrSock.GetSocketData()-&gt;_protocol); \</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">        if (ec) \</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">        { \</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">            goto lable; \</span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor">        }\</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">    }\</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#adc07ff0ff536a0d98f5a0a906f7592a7">   78</a></span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor">#define CHECK_SOCKET_INIT(bInit, cliSock, svrSock, ec) {\</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor">    if (!cliSock.GetServiceBuffer()) \</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="preprocessor">    {\</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::UNINIT); \</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">    }\</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">    if (bInit &amp;&amp; *cliSock.GetSockPtr() == INVALID_SOCKET) \</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">    { \</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor">        ec = cliSock.Socket(svrSock.GetSocketData()-&gt;_sockaddr.GetDomain(), svrSock.GetSocketData()-&gt;_type, svrSock.GetSocketData()-&gt;_protocol); \</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="preprocessor">    }\</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a61a4de8159564bd2075db44c463f7a37">   89</a></span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#define CHECK_SOCKET_ACCEPT(bInit, sock, svrSock, ec) {\</span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">    if(svrSock.GetServiceBuffer() == NullPtr){ \</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::NOLISTEN); \</span></div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor">    }else if(svrSock.GetService()-&gt;GetIoPortService() != this) { \</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::BIND_SERVER_ERROR); \</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="preprocessor">    }else{ \</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor">        CHECK_SOCKET_INIT(bInit, sock, svrSock, ec); \</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="preprocessor">    } \</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a0963ca422eb34520198e31cf6b177363">   99</a></span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="preprocessor">#define CHECK_SOCKET_ACCEPT_GOTO(bInit, cliSock, svrSock, ec, lable) {\</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="preprocessor">    if(svrSock.GetService()-&gt;GetIoPortService() != this) { \</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::BIND_SERVER_ERROR); \</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="preprocessor">        goto lable; \</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="preprocessor">    }else{ \</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="preprocessor">        CHECK_SOCKET_INIT_GOTO(bInit, cliSock, svrSock, ec, lable); \</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="preprocessor">    } \</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#ab35422cd5048a841c614a13ab1e34b30">  108</a></span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="preprocessor">#define CHECK_SOCKET_BIND_AND_INIT_SERVER_GOTO(sock, ec, lable){ \</span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor">    if (sock.GetServiceBuffer() == NullPtr || *sock.GetSockPtr() == INVALID_SOCKET) \</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="preprocessor">    { \</span></div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::UNINIT); \</span></div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="preprocessor">        goto lable; \</span></div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="preprocessor">    } \</span></div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="preprocessor">    CHECK_BIND_SERVER_GOTO(sock, ec, lable); \</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#a93c0956b3d2ecf21de89ba8aec089c3c">  117</a></span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">#define CHECK_SOCKET_BIND_AND_INIT_SERVER(sock, ec){ \</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="preprocessor">    if (sock.GetServiceBuffer() == NullPtr) \</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="preprocessor">    { \</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="preprocessor">        ec.SetError(CSockError::UNINIT); \</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="preprocessor">    } \</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="preprocessor">    CHECK_BIND_SERVER(sock, ec); \</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#ae254bb5047b6c4c99a9e302b87041eef">  125</a></span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="preprocessor">#define CHECK_HANDLE_AND_RETURN(hHandle, ec, dwLogLevel){ \</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="preprocessor">if (!hHandle) { ec.SetError(CSockError::SYS_ERROR); WRITELOGMSG(&quot;handle is nullptr=&gt;&quot;, ec.GetErrorMsg(), dwLogLevel); return ec; }; \</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="preprocessor">}</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="socket_2internal_2_macro_tools_8h.html#ada547345b32daf26df355a2b3d9b5a06">  129</a></span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="preprocessor">#define MAX_EVENTS_SIZE 256</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="preprocessor">#endif // #ifndef ____SOCKTOOLS_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1a1240b20d386d820628fc3346421cb5be"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a1240b20d386d820628fc3346421cb5be">ASYNC_NORMAL</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00025">MacroTools.h:25</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1a53a0b28e438eedaa078b3e5caf7683b0"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a53a0b28e438eedaa078b3e5caf7683b0">ASYNC_ACCEPT</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00032">MacroTools.h:32</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a77c97c2869d7aeef57d865d61467fe11">ASYNC_MAX</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00034">MacroTools.h:34</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a8ca3850e00ae5fc952cc19fe8e1983c0"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0">UpdateAction</a></div><div class="ttdeci">UpdateAction</div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00037">MacroTools.h:37</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1">IoCompleteKey</a></div><div class="ttdeci">IoCompleteKey</div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00023">MacroTools.h:23</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1ae9092fcf5b69fe04c51407da6f78d71a"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1ae9092fcf5b69fe04c51407da6f78d71a">ASYNC_INIT</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00031">MacroTools.h:31</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a6a02b2d1d62293b20242e3dcfbdd0117ab3eb5fc1c2881f12082d288b4fc0362a"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117ab3eb5fc1c2881f12082d288b4fc0362a">read_op</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00024">MacroTools.h:24</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a8ca3850e00ae5fc952cc19fe8e1983c0abfd6aec6483c4db68bcdd242b3712e2f"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0abfd6aec6483c4db68bcdd242b3712e2f">UPDATE_ACTION</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00040">MacroTools.h:40</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1a98eb1c6912b405f72077623bf35b84d0"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a98eb1c6912b405f72077623bf35b84d0">ASYNC_EXIT</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00028">MacroTools.h:28</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1a0bf0069a0dc92f478e26530b34724c54"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a0bf0069a0dc92f478e26530b34724c54">ASYNC_COMPLETE</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00029">MacroTools.h:29</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a6a02b2d1d62293b20242e3dcfbdd0117a495315afb928424392a304f43d96cadb"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117a495315afb928424392a304f43d96cadb">write_op</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00025">MacroTools.h:25</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1a411478bc403c60e45d9ec2a8a81ccff5"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1a411478bc403c60e45d9ec2a8a81ccff5">ASYNC_TIMEOUT</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00027">MacroTools.h:27</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a8ca3850e00ae5fc952cc19fe8e1983c0aad86562c2b3d6e7eb6f89c9e373d916b"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0aad86562c2b3d6e7eb6f89c9e373d916b">DELETE_ACTION</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00039">MacroTools.h:39</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1acbced1b41bfc12f3d43285c159dbd2cf"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1acbced1b41bfc12f3d43285c159dbd2cf">ASYNC_CONNECT</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00033">MacroTools.h:33</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a188154dc119900e88c49eb1509810eb1add077376f83a9d647391982e5ab6165f"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a188154dc119900e88c49eb1509810eb1add077376f83a9d647391982e5ab6165f">ASYNC_CLOSE</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00026">MacroTools.h:26</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a6a02b2d1d62293b20242e3dcfbdd0117"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117">OperatorType</a></div><div class="ttdeci">OperatorType</div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00016">MacroTools.h:16</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a8ca3850e00ae5fc952cc19fe8e1983c0a6fdfab6b4db26c3b4f122765b77e5061"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a8ca3850e00ae5fc952cc19fe8e1983c0a6fdfab6b4db26c3b4f122765b77e5061">ADD_ACTION</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00041">MacroTools.h:41</a></div></div>
<div class="ttc" id="asocket_2internal_2_macro_tools_8h_html_a6a02b2d1d62293b20242e3dcfbdd0117a0fe13fc305ec60c5bb2c1cf11115ba4c"><div class="ttname"><a href="socket_2internal_2_macro_tools_8h.html#a6a02b2d1d62293b20242e3dcfbdd0117a0fe13fc305ec60c5bb2c1cf11115ba4c">op_size</a></div><div class="ttdef"><b>Definition:</b> <a href="socket_2internal_2_macro_tools_8h_source.html#l00026">MacroTools.h:26</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
